# -*- coding: UTF-8 -*-

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
import time


def logint():
    driver=webdriver.Chrome()
    driver.get("https://test.rabbitpre.com/")
    # driver.maximize_window()
    locator=(By.ID,"g-j-signin-btn")
    WebDriverWait(driver,10).until(EC.visibility_of_element_located(locator))
    loginbtn=driver.find_element_by_id("g-j-signin-btn")
    loginbtn.click()
    frameselect=driver.find_element_by_id("sso")
    driver.switch_to.frame(frameselect)
    loginchoice=driver.find_element_by_css_selector("span[data-type='tuzhan']")
    loginchoice.click()
    driver.find_element_by_css_selector("input[placeholder='请输入你的登录账户']").send_keys("15507553617")
    driver.find_element_by_css_selector("input[placeholder='请输入密码']").send_keys("123456")
    loginbtn2=driver.find_element_by_css_selector("button.g-btn.login-btn.do-btn")
    loginbtn2.click()
    time.sleep(5)
    driver.quit()

logint()